package org.infodavid.common.registry.impl;

import java.io.Serializable;

import org.infodavid.common.registry.IRegistry;
import org.infodavid.common.registry.IRegistryEvent;

/**
 * The Class RegistryEventImpl.
 * @param <K> the type of the keys
 * @param <E> the type of the elements
 */
public class RegistryEventImpl<K extends Serializable,E extends Serializable> implements
    IRegistryEvent<K,E> {

	/** serialVersionUID. */
	private static final long serialVersionUID = -1605132235123367861L;

	/** The entry. */
	private final E entry;

	/** The key. */
	private final K key;

	/** The registry. */
	private final transient IRegistry<K,E> registry;

	/**
	 * The Constructor.
	 * @param arg0 the arg0
	 * @param arg1 the arg1
	 * @param arg2 the arg2
	 */
	public RegistryEventImpl(final IRegistry<K,E> arg0, final K arg1, final E arg2) {
		registry = arg0;
		key = arg1;
		entry = arg2;
	}

	/*
	 * (non-Javadoc)
	 * @see org.infodavid.common.registry.IRegistryEvent#getEntry()
	 */
	public E getEntry() {
		return entry;
	}

	/*
	 * (non-Javadoc)
	 * @see org.infodavid.common.registry.IRegistryEvent#getKey()
	 */
	public K getKey() {
		return key;
	}

	/*
	 * (non-Javadoc)
	 * @see org.infodavid.common.registry.IRegistryEvent#getRegistry()
	 */
	public IRegistry<K,E> getRegistry() {
		return registry;
	}

}
